package pl.edu.agh.anomalyids.network.header.impl;

import pl.edu.agh.anomalyids.network.header.Header;

public class ICMPHeader implements Header {

	private static final long serialVersionUID = 1L;
	
	private int type;
	private int code;
	
	public int getType() {
		return type;
	}
	
	public void setType(int type) {
		this.type = type;
	}
	
	public int getCode() {
		return code;
	}
	
	public void setCode(int code) {
		this.code = code;
	}
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		
		builder.append("======= ICMP ======\n");
		builder.append("Type: ");
		builder.append(getType());
		builder.append("\n");
		builder.append("Code: ");
		builder.append(getCode());
		builder.append("\n");
		
		return builder.toString();
	}
	
	@Override
	public String getName() {
		return "ICMP";
	}
}
